package com.puzzlebazar.client.squaregrid.control;

import com.google.gwt.event.dom.client.MouseEvent;
import com.google.gwt.event.shared.EventHandler;
import com.puzzlebazar.client.util.Vec2i;

public interface ComponentCallback {
	
	/**
	 * Mouse down at a specific location
	 * 
	 * @param loc Location (cell, vertex, edge) of the event
	 * @param event The mouse event itself
	 * @return True if the event has been handled, false otherwise
	 */
	boolean mouseDown(Vec2i loc, MouseEvent<? extends EventHandler> event);

	/**
	 * Mouse up at a specific location
	 * 
	 * @param loc Location (cell, vertex, edge) of the event
	 * @param event The mouse event itself
	 * @return True if the event has been handled, false otherwise
	 */
	boolean mouseUp(Vec2i loc, MouseEvent<? extends EventHandler> event);

	/**
	 * Check if the callback can handle mouse entering at a specific location
	 * 
	 * @param loc Location (cell, vertex, edge)
	 * @param event The mouse event itself
	 * @return True if the event can be handled, false otherwise
	 */
	boolean canHandleMouseEnter(Vec2i loc, MouseEvent<? extends EventHandler> event);

	/**
	 * Mouse enters a specific location
	 * 
	 * @param loc Location (cell, vertex, edge) of the event
	 * @param event The mouse event itself
	 * @return True if the event has been handled, false otherwise
	 */
	boolean mouseEnter(Vec2i loc, MouseEvent<? extends EventHandler> event);

	/**
	 * Mouse leaves a specific location
	 * 
	 * @param loc Location (cell, vertex, edge) of the event
	 * @param event The mouse event itself
	 * @return True if the event has been handled, false otherwise
	 */
	boolean mouseLeave(Vec2i loc, MouseEvent<? extends EventHandler> event);

}
